package com.panfeng.xcloud.boss.provider.member.dao.mapper;

import com.panfeng.xcloud.boss.provider.member.dto.request.ActiveInfoRespDTO;
import com.panfeng.xcloud.boss.provider.member.dto.request.ChildActiveInfoPageReqDTO;
import com.panfeng.xcloud.boss.provider.member.web.vo.response.ChildActiveInfoRespDTO;
import com.panfeng.xcloud.dao.member.entity.UserActive;
import com.panfeng.xcloud.dao.member.mapper.UserActiveMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface UserActiveMapperExt extends UserActiveMapper {


    UserActive select(@Param("userActive") UserActive userActive);

    BigDecimal findTodayActive(String userId);

    UserActive query(@Param("userActive") UserActive userActive);

    /**
     * 插入或者更新把今天的用户活跃度更新或者插入到昨天的用户活跃度
     *
     * @return
     */
    int insertAndUpdateUserActiveForYesterday();

    /**
     * 设置活跃度清理零更新
     *
     * @return
     */
    int updateUserActiveForTodays();

    List<UserActive> findParentActive(String userId);

    List<String> findLargeAreaActiveUserId(String userId);

    Long findIsLargeAreaActiveUserId(@Param("uId") String uId, @Param("userId") String userId);

    void batchUpdate(@Param("userActiveList") List<UserActive> userActiveList);

    List<String> findUserActiveNotExistParentId(String userId);

    List<String> findUserActiveNotExistUserId(String userId);

    void batchAdd(@Param("userActiveList") List<UserActive> userActiveList);

    void updateByUserId(UserActive myActive);

    int updateYesterdayDay();

    void clearUserActiveForDays();

    ActiveInfoRespDTO queryActiveInfo(@Param("userId") String userId);

    List<ChildActiveInfoRespDTO> queryActiveInfoForChildPage(@Param("childActiveInfoPageReqDTO") ChildActiveInfoPageReqDTO childActiveInfoPageReqDTO);

    long queryActiveInfoForChildCount(@Param("childActiveInfoPageReqDTO") ChildActiveInfoPageReqDTO childActiveInfoPageReqDTO);

    List<ChildActiveInfoRespDTO> queryActiveInfoForChild(@Param("userId") String userId, @Param("activeOrder")Integer activeOrder, @Param("ocrAuthStatus")Integer ocrAuthStatus);
}